function ajax(options) {
	let _options = Object.assign({
		type: "get"
	}, options);
	
	if(_options.type == "jsonp") {
		let funName = "_JSONP_"+parseInt(Math.random()*100000)+new Date().getTime();
		
		let _script = document.createElement("script");
		_script.src = `${_options.url}&cb=${funName}&callback=${funName}`;
		document.body.appendChild(_script);
		
		window[funName] = function(data){
			_options.success(data);
			_script.remove();
			delete window[funName];
		}
	} else {
		let xhr = new XMLHttpRequest();
		xhr.open( _options.type, _options.url );
		
		if(window.VBArray) {
			xhr.onreadystatechange = function(){
				if(xhr.readyState == 4) {
					_options.success( JSON.parse(xhr.responseText) );
				}
			}
		} else {
			xhr.onload = function(){
				_options.success( JSON.parse(xhr.response) );
			}
		}
		xhr.send();
	}
}
